//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<RegularGameMessage.h>
///	@path	~/src/appear/xwin/
///	@date	2007/11/06
///	@desc	Regular game message filter.

#pragma once

#include "xeres.h"

#include "engine/xcore/CWindowEvent.h"
#include "engine/xcore/xeres_engine.h"

#include "appear/app/message_filter.h"

namespace xeres {

	/*!
		\class	RegularGameMessage
		\brief
	*/
	class RegularGameMessage : public MessageFilter
	{
	public:

		/// \ctor
		RegularGameMessage( void );

		/// \dtor
		virtual ~RegularGameMessage( void );

	//@ interface

		/*!
			\brief		Filter messages,
						return true to stop next level,
						otherwise engine will search next filter.
		*/
		virtual bool Filter( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam );

	//@ local

		/*!
			\brief		Create event object & register callback.
		*/
		bool ConnectEngine( Engine& engine );

	private:

	//@ data

		// activate app
		Ref< CWindowEvent >		m_activate;

		// on size
		Ref< CWindowEvent >		m_size;

		// on paint
		Ref< CWindowEvent >		m_paint;

	};

} // namespace xeres
